Higher-order Programming in an Or-intensive Style

نویسندگان

  • Paul Tarau
  • Bart Demoen
چکیده

Because implementations tend to favour a recursive deterministic AND-intensive programming style, it seems counter intuitive that a backtrack-ing findall-based paradigm can be more eecient. This is explained by a source level technique which is called goal precomputation, by a heap-based copy-once ndall and optimized meta predicates. A precomputed goal containing a future (reusable) computation is backtracked over instead of being constructed repeatedly. These techniques are enough, in terms of eeciency, to rehabilitate a generator based OR-intensive programming style. On the other side, we will try to nd out how to improve the traditional AND-intensive implementation of higher-order primitives and study the impact of meta-programming constructs like call/N. We introduce a newùniversal' higher-order predicate implemented also with goal precomputation which combines on the y selected answers from a generator. By using it for the executable speciication of key higher-order Prolog constructs, we point out the (unsuspected) expressive power of a pure OR-intensive programming style.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Higher Order Imperative Programming

It is argued that a programming style based on higher order techniques the use of procedures that have other procedures as arguments and or results can be most e ectively employed if it is driven by abstraction from real algorithms rather than attempting to work with a xed set of functional forms and the use of imperative forms and mutative procedures is permitted even encour aged rather than r...

متن کامل

Application of stochastic programming for iron ore quality control

Stockpiling and blending play a major role in maintaining the quantity and quality of the raw materials fed into processing plants, especially the cement, iron ore and steel making, and coal-fired power generation industries that usually require a much uniformed feed. Due to the variable nature of such materials, they even come from the same source and the produced ores or concentrates are seld...

متن کامل

Higher-Order Chemical Programming Style

The chemical reaction metaphor describes computation in terms of a chemical solution in which molecules interact freely according to reaction rules. Chemical solutions are represented by multisets of elements and reactions by rewrite rules which consume and produce new elements according to conditions. The chemical programming style allows to write many programs in a very elegant way. We go one...

متن کامل

EriLex: An Embedded Domain Specific Language Generator

EriLex is a software tool for generating support code for embedded domain speci c languages (EDSL). EriLex supports de ning the syntax, static semantics, and dynamic semantics of EDSLs desigined in the method chaining style, the functional nesting style, or both. EriLex supports various features of EDSLs that are commonly used in manually written EDSL libraries, in addition to other less freque...

متن کامل

Constraint Imperative Programming with Higher-order Functions

In constraint programming, programs are written by mainly specifying the properties which must hold for a solution of a given problem. In contrast, imperative programming languages require that the programmer explicitly specifies each state transition a program must perform in order to calculate the solution. This paper describes a programming style which consists of these both views as well as...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007